﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SetShortCutWindow.aspx.cs" Inherits="PMS.UI.BD.SetShortCutWindow" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
   <script type="text/javascript">
       var Assign = {};
       var userId;
       $(function () {
           com.ajax({
               url: "/Logic/BD/UserAjax.aspx?method=GetShortCutList",
               type: "POST",
               data: { Id: userId },
               success: function (data) {
                   LoadRole(data);
               }
           });

       });

       function LoadRole(r) {

           for (var i = 0; i < r.length; i++) {
               if (r[i].Checked == true) {
                   $("<div class='fitAssignPer'><input type='checkbox' checked='true' value='" + r[i].value + "'/>" + r[i].text + "</div>").appendTo(("#divUl"));
               }

               else {
                   $("<div class='fitAssignPer'><input type='checkbox' value='" + r[i].value + "'/>" + r[i].text + "</div>").appendTo(("#divUl"));
               }

           }

       }

       Assign.Cancel = function () {
           $("#divChangePwd").dialog('close');
       }

       Assign.Confirm = function () {
           var roleIds = "";
           //1.获取所选角色
           var $roles = $(".fitAssignPer > input:checked").each(function () { roleIds += $(this).val() + ',' });
           com.ajax({
               url: "/Logic/BD/UserAjax.aspx?method=EditShortCut",
               data: { Id: userId, ShortIds: roleIds },
               success: function (data) {
                   com.message(data.state, data.msg, function () {
                       $("#divChangePwd").dialog('close');
                   })
               }
           });
       }
</script>
<div id="divUl" style="height: 220px; width: 100%; overflow: auto">
</div>
<div class="dialog-bottom">
    <input type="hidden" id="hidAddRole.Action" />
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="Assign.Confirm()">确定</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="Assign.Cancel()">取消</a>
</div>

</body>
</html>
